package com.bosssoft.service.impl;

import com.bosssoft.entity.dto.FibIncomeBudgetDetailDTO;
import com.bosssoft.entity.po.FibIncomeBudgetDetailPO;
import com.bosssoft.exception.DaoException;
import io.swagger.models.auth.In;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bosssoft.mapper.FibIncomeBudgetDetailMapper;
import com.bosssoft.service.FibIncomeBudgetDetailService;

import javax.annotation.Resource;

import static com.bosssoft.enums.BgtCode.SAVE_FAIL;

/**
 * @author Li kexi
 * Created on 2021/8/19.15:46
 */
@Service
public class FibIncomeBudgetDetailServiceImpl extends ServiceImpl<FibIncomeBudgetDetailMapper, FibIncomeBudgetDetailPO> implements FibIncomeBudgetDetailService{

    @Resource
    private FibIncomeBudgetDetailMapper fibIncomeBudgetDetailMapper;

    @Override
    public int updateBatch(List<FibIncomeBudgetDetailPO> list) {
        return baseMapper.updateBatch(list);
    }
    @Override
    public int updateBatchSelective(List<FibIncomeBudgetDetailPO> list) {
        return baseMapper.updateBatchSelective(list);
    }
    @Override
    public int batchInsert(List<FibIncomeBudgetDetailPO> list) {
        return baseMapper.batchInsert(list);
    }
    @Override
    public int insertOrUpdate(FibIncomeBudgetDetailPO record) {
        return baseMapper.insertOrUpdate(record);
    }
    @Override
    public int insertOrUpdateSelective(FibIncomeBudgetDetailPO record) {
        return baseMapper.insertOrUpdateSelective(record);
    }

    @Override
    public boolean addIncomeDetail(FibIncomeBudgetDetailDTO detailDTO) {
        FibIncomeBudgetDetailPO detailPO = new FibIncomeBudgetDetailPO();
        BeanUtils.copyProperties(detailDTO,detailPO);
        boolean save = save(detailPO);
        return save;
    }

    @Override
    public int updateForeign(Long foreign) {
        int i = baseMapper.updateForeign(foreign);
        return i;
    }
}
